home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-03-06 | 1.5 KB | 38 lines | [TEXT/GEOL] |
- Item 9533643 1-Feb-91 07:39PST
-
- From: MUYSVASOVIC ACE - Jean-Denis Muys-Vasovic
-
- To: HOWTEK.TECH Howtek, Cory Kempf,PRT
- CPLUS.DEV$ C++ Interest List--Developers
- CPLUS.APPLE$ C++ Interest List--Apple Employees
-
- ------------------------------------------------------------------------------
-
- Sub: Re: Code Resources & Pure Virt
-
- Dear Grr,
-
- Do you really think that the compiler should output the full TN and the full
- appendix from the MPW documentation?
-
- I personally believe that the linker message is terse, but informative. In a
- few words, there is a reference from data to code because you try to take the
- address of one of your procedure (in C: int (funptr*)() = &myProc;). In the
- Macintosh run time environment, the address of a procedure can change over
- time, and so the real address cannot be stored in your variable. For that to
- work, you need a relay, the address of which never changes: a jump table, and
- thus an A5 world, which you can't have in a code resource (well, you can, but
- you must fool the linker, and be very cautious).
-
- In the case of of C++, a vtable is a data structure containing the adresses of
- some functions, thus the data to code reference.
-
- All this is fully documented in the MPW appendix about the object code file
- format, and also in the TN about globals in standalone code, and also in a
- recent issue of Develop.
-
- Regards
-
- Jean-Denis
-
-